<template>
	<view>
		<view class="" style="padding-bottom: 30rpx;">
			<view class="topbgc"></view>
			<view class="" style="position: relative;z-index: 100;">
				<view class="flexbetween mainpadding" style="padding-top: 140rpx;" v-if="!is_login" @click="login()">
					<view class="flexleft">
						<image src="@/static/images/system/weidenglu.png" class="headimg margin_right" mode=""></image>
						<view class="sanshier xiaohei bold">未登录，点击去登录</view>
					</view>
					<u-icon name="arrow-right" color="#999" size="24"></u-icon>
				</view>
				<view class="flexbetween mainpadding" style="padding-top: 140rpx;" v-if="is_login"
					@click="jumpurl('/pages_mypage/gerenxx')">
					<view class="flexleft">
						<image :src="userInfo.avatar_text" class="headimg margin_right" mode=""></image>
						<view class="flexcolumnbet" style="height: 100rpx;">
							<view class="sanshier xiaohei bold">{{userInfo.nickname}}</view>
							<view class="xiaohuang main_size" @click.stop="copy(userInfo.invite_code)">邀请码：<text  style="text-decoration: underline;">{{userInfo.invite_code}}</text></view>
						</view>
					</view>
					<u-icon name="arrow-right" color="#999" size="24"></u-icon>
				</view>
				<view class="mainpadding">
					<view class="jfbgc flexbetween" @click="jumpurl('/pages_mypage/wodejb')">
						<view class="">
							<view class="sanshier xiaobai">账户金币（个）</view>
							<view class=" xiaobai bold margin_top2" style="font-size: 50rpx;">{{userInfo.money || "0"}}
							</view>
						</view>
						<view class="chakan titletext xiaobai">查看</view>
					</view>
				</view>
				
			</view>
			<view class="mainpadding2">
				<view class="mainpadding ffffff radius">
					<view class="flexbetween xiahuaxian" @click="jumpurl('/pages_mypage/kaijiangdd')">
						<view class="flexleft">
							<image src="@/static/images/system/my1.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">订单</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" v-if="!isSH" @click="jumpurl('/pages_mypage/wodesp')">
						<view class="flexleft">
							<image src="@/static/images/system/my5.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">我的晒票</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" v-if="is_login && userInfo.is_fy==2" @click="jumpurl('/pages_mypage/wodetg')">
						<view class="flexleft">
							<image src="@/static/images/system/my2.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">我的推广</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian"  v-if="is_login && userInfo.is_cys==2" @click="jumpurl('/pages_mypage/haomagl')">
						<view class="flexleft">
							<image src="@/static/images/system/my6.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">胆码开奖号管理</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" @click="show=true">
						<view class="flexleft">
							<image src="@/static/images/system/my3.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">联系客服</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4" @click="jumpurl('/pages_mypage/shezhi')">
						<view class="flexleft">
							<image src="@/static/images/system/my4.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">设置</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
				</view>
				<view class="textcenter xiaohui smalltext margin_top6">吉林省鼎祥装饰工程有限公司 版权所有</view>
			</view>
		</view>
		<u-popup mode="center" round="10" :show="show" @close="show=false">
			<view class="mainpadding4 radius" style="min-width: 600rpx;background-color: #fafafa;">
				<view class="textcenter xiaohei bigtext fonweight">请选择您要联系的客服</view>
				<view class="smalltext textcenter xiaohui margin_top2">我们根据您的选择为您提供服务</view>
				<view class="mainpadding2s flexbetween ffffff margin_top7">
					<view class="">
						<view class="xiaohei titletext fonweight">平台客服</view>
						<view class="ershil xiaohui margin_top2">{{pt_kf}}</view>
					</view>
					<image src="../static/images/system/phone.png" style="width: 80rpx;height: 80rpx;" @click="callphone(pt_kf)" mode=""></image>
				</view>
				<view class="mainpadding2s flexbetween ffffff margin_top">
					<view class="">
						<view class="xiaohei titletext fonweight">彩研师客服</view>
						<view class="ershil xiaohui margin_top2">{{cys_kf}}</view>
					</view>
					<image src="../static/images/system/phone.png" style="width: 80rpx;height: 80rpx;" @click="callphone(cys_kf)"  mode=""></image>
				</view>
				<view class="flexcenter">
					<view class="bigbtn margin_top7" style="width: 400rpx;" @click="show=false">确定</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				is_login: false,
				userInfo: {},
				show: false,
				cys_kf:"",
				pt_kf:"",
				isSH: true
			}
		},
		onLoad() {
			this.getsystem()
		},
		onShow() {
			this.getshenhe()
			this.is_login = httpRequest.checkIsLogin();
			if (this.is_login) {
				this.init()
			} else {
				this.userInfo = {}
			}
		},
		methods: {
			getshenhe() {
				let _this = this
				let system = uni.getSystemInfoSync()
				let version_code = system.appVersionCode
				let platform = system.platform
				httpRequest.request('/api/index/checkApply', 'GET', {
					platform,
					version_code
				}).then(res => {
					console.log(version_code, platform, res);
					this.isSH = res.data
				})
			},
			getsystem(){
				httpRequest.request('/api/index/getConfigInfoItem', 'POST', {
					pidtype:"otherset",
					type:"pt_kf",
				}).then(res => {
					this.pt_kf = res.data
				})
				httpRequest.request('/api/index/getConfigInfoItem', 'POST', {
					pidtype:"otherset",
					type:"cys_kf",
				}).then(res => {
					this.cys_kf = res.data
				})
			},
			init() {
				httpRequest.request('/api/user/index', 'GET', {}).then(res => {
					this.userInfo = res.data
					uni.setStorageSync('invite_code',res.data.invite_code);
				})
			},
			login() {
				uni.navigateTo({
					url: "/pages/login/login"
				})
			},
			jumpurl(url) {
				if (!httpRequest.checkIsLogin()) {
					uni.navigateTo({
						url: "/pages/login/login"
					})
					return false
				}
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.topbgc {
		background-image: url("@/static/images/system/bjc.png");
		width: 100%;
		height: 400rpx;
		background-size: 100% 100%;
		position: fixed;
		top: 0;
		left: 0;
		z-index: -1;
	}
	.jfbgc {
		background-image: url("");
		padding: 30rpx 50rpx;
		box-sizing: border-box;
		background-size: 100% 100%;
	}

	.chakan {
		padding: 15rpx 40rpx;
		border-radius: 50rpx;
		border: 1rpx solid #fff;
	}

	.lefticon {
		width: 40rpx;
		height: 40rpx;

	}

	.xiahuaxian {
		padding-bottom: 40rpx;
	}
</style>